/*
 * @Descripttion: HN-SaaS管理系统
 * @version: 1.0.0
 * @Author: 侯建军
 * @Date: 2020-09-03 09:03:18
 * @LastEditors: 侯建军
 * @LastEditTime: 2020-09-11 13:46:31
 */
import request from '@/utils/request'

/**
 * 添加用户
 * @param {*} user 
 */
export function insert(user) {
    return request({ url: "/user", method: "post", data: user });
}

/**
 * 登录函数
 * @param {} website 
 */
export function login(login) {
    return request({ url: "/index/login", method: "post", params: login });
}
/**
 * 获取分页数据
 * @param { } keyword 
 */
export function getUsers(keyword) {
    return request({ url: "/user/list", method: "post", data: keyword });
}
/**
 * 更新用户
 * @param {*} id 
 */
export function update(user){
    return  request({ url: "/user", method: "put",data: user});
}
/**
 * 删除用户
 * @param {*} id 
 */
export function remove(id){
    return  request({ url: "/user/"+id, method: "delete"});
}
/**
 * 根据用户ID获取用户
 * @param {*} id 
 */
export function getUser(id){
    return  request({ url: "/user/"+id, method: "get"});
}

/**
 * 根据账号获取用户
 * @param {*} id 
 */
export function getUserByUsername(username){
    return  request({ url: "/user/info/"+username, method: "get"});
}
